﻿using AuthorityManagement.Controllers;
using AuthorityManagement.Model;
using AutoMapper;
using static AuthorityManagement.Controllers.TreeMenuController;

namespace AuthorityManagement.AutoMapper
{
    public class treeMenuMapper : Profile
    {
        public treeMenuMapper()
        {
            CreateMap<TreeMenuSelectDto, TreeMenu>()
               .ForMember(d => d.Desc, dst => dst.MapFrom(s => s.Name))
           .ForMember(d => d.Desc, dst => dst.MapFrom(s => s.Name));

            CreateMap<TreeMenu, TreeMenuSelectDto>()
              .ForMember(d => d.Name, dst => dst.MapFrom(s => s.Desc))
          .ForMember(d => d.Name, dst => dst.MapFrom(s => s.Desc));
        }
    }
}
